package svc

import (
	externalModel "Hist-Hr/app/form/model"
	"Hist-Hr/app/task/cmd/rpc/submission/internal/config"
	"Hist-Hr/app/task/model"
	userauthModel "Hist-Hr/app/userauth/model"
)

type ServiceContext struct {
	Config          config.Config
	SubmissionModel model.SubmissionModel
	EntryFormModel  externalModel.EntryFormModel
	UserInfoModel   userauthModel.UserInfoModel
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:          c,
		SubmissionModel: model.NewSubmissionModel(c.MongoConf.URL, c.MongoConf.DB, "submission"),
		EntryFormModel:  externalModel.NewEntryFormModel(c.MongoConf.URL, c.MongoConf.DB, "entry_form"),
		UserInfoModel:   userauthModel.NewUserInfoModel(c.MongoConf.URL, c.MongoConf.DB, "userinfo"),
	}
}
